package asu.command
{
	import flash.events.Event;
	import flash.events.IEventDispatcher;
	
	public class LoadXMLCommand extends LoadURLCommand
	{
		protected var _xml		:XML;
		
		public function LoadXMLCommand(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		public function get xml():XML
		{
			return _xml;
		}

		public function loadXML( url:String, useNoCache:Boolean=false ):void
		{
			_load( url, useNoCache );
		}
		
		override protected function completeHandler(event:Event):void
		{
			try
			{
				_xml = XML( loader.data );
				//trace( _xml );
				dispatchEvent( event );
			}
			catch( e:Error )
			{
				trace( this, e.message );
				handleError( e.message );
			}
		}
	}
}